package com.sec.android.app.myfiles.shadow.custom;

import android.content.Context;
import android.media.MediaScannerConnection;
import android.os.UserHandle;
import android.os.storage.StorageManager;
import android.os.storage.StorageVolume;

import com.sec.android.app.myfiles.mockclass.FileInputStreamMock;
import com.sec.android.app.myfiles.mockclass.FileMock;
import com.sec.android.app.myfiles.mockclass.FileOutputStreamMock;
import com.sec.android.app.myfiles.shadow.android.ShadowStorageManager;
import com.sec.android.app.myfiles.util.SemFwWrapper;

import org.robolectric.annotation.Implementation;
import org.robolectric.annotation.Implements;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.util.List;

/**
 * Created by jaebae on 2016-07-01.
 */
@Implements(SemFwWrapper.class)
public class ShadowSemFwWrapper {
    @Implementation
    public static File file(String path) {
        return FileMock.createMock(path);
    }

    @Implementation
    public static FileInputStream inputStream(File file) {
        return FileInputStreamMock.createMock(file);
    }

    @Implementation
    public static FileOutputStream outputStream(File file) {
        return FileOutputStreamMock.createMock(file);
    }

    @Implementation
    public static List<StorageVolume> getStorageVolumes(StorageManager storageManager) {
        return ShadowStorageManager.getStorageVolumes();
    }

    @Implementation
    public static String semGetPath(StorageVolume storageVolume) {
        return ShadowStorageManager.getVolumePath(storageVolume);
    }

    @Implementation
    public static String getState(StorageVolume storageVolume) {
        return "mounted";
    }

    @Implementation
    public static int semGetMyUserId() {
        return UserHandle.SEM_USER_CURRENT;
    }

    @Implementation
    public static void semScanDirectories(Context context, String[] directories, MediaScannerConnection.OnScanCompletedListener callback) {

    }
}
